<!DOCTYPE html>
<html>
<head>
    <title>{$name} {$seo_title} {$site_name}</title>
    <meta name="keywords" content="{$seo_keywords}" />
    <meta name="description" content="{$seo_description}">
    <tc_include file="Public:head" />
</head>
<body>
    <tc_include file="Public:nav" />
    <div class="container tc-main">

        <intput id="hid_select" title="{$name}" type="hidden"></intput>
        <div class="row">

            <div class="span9">
                <div class="tc-box" style="height:330px;padding:0px 0px">
                    <div style="width:545px; float:left;position:relative;margin-left:20px">
                        <div id="slider-container">
                            <div id="box_skitter_large" class="box_skitter box_skitter_large">
                                <php>
                                    $hot_articles=sp_sql_posts("cid:$par_id;field:post_title,post_excerpt,object_id,term_id,smeta;order:istop DESC, listorder asc,post_date DESC;where istop=1;limit:0,3;");
                                </php>
                                <ul>
                                    <foreach name="hot_articles" item="vo">
                                        <li>
                                            <php>
                                                $smeta=json_decode($vo['smeta'], true);
                                            </php>

                                            <if condition="!empty($smeta['thumb'])">
                                                <div class="item-image">
                                                    <a href="{:leuu('article/index',array('id'=>$vo['object_id'],'cid'=>$vo['term_id']))}">
                                                        <img src="{:sp_get_asset_upload_path($smeta['thumb'])}"
                                                             class="img-responsive" style="width:100%; height:100%" alt="{$vo.post_title}">
                                                    </a>
                                                </div>
                                                <else />
                                            </if>

                                            <div class="label_text">
                                                <a href="{:leuu('article/index',array('id'=>$vo['object_id'],'cid'=>$vo['term_id']))}">
                                                    <h3 class="colortext uppercase">
                                                        {$vo.post_title}
                                                    </h3>
                                                </a>
                                            </div>
                                        </li>
                                    </foreach>
                                </ul>
                            </div>
                            <!--<div id="shadow-img-slider"></div>-->
                        </div>
                    </div>
                    <div style="width:280px; float:right;position:relative;margin-top:-4px;margin-right: 20px;">
                        <php>
                            $hot_articles=sp_sql_posts("cid:$par_id;field:post_title,post_excerpt,object_id,term_id,smeta;order:istop DESC,listorder asc, post_date DESC;where istop=1;limit:3,2;");
                        </php>
                        <foreach name="hot_articles" item="vo">
                            <php>
                                $smeta=json_decode($vo['smeta'], true);
                            </php>
                            <if condition="!empty($smeta['thumb'])">
                                <a href="{:leuu('article/index',array('id'=>$vo['object_id'],'cid'=>$vo['term_id']))}">
                                    <div class="item-image" style="height:160px;overflow:hidden;width:100%;margin-top:4px;">
                                        <span style="filter:alpha(opacity=50); -moz-opacity:0.5; opacity:0.5; background:#AEAEAE; margin-top:110px; height:50px; position: absolute; width: 100%"></span><font class="fontmsyh" style="margin-top:110px; height:25px; line-height:25px; font-size:12px; text-align:left; color:#ffffff; position: absolute; width: 95%;padding-left:10px">{$vo.post_title}</font>

                                        <img src="{:sp_get_asset_upload_path($smeta['thumb'])}" style="width:100%; height:100%"
                                             class="img-responsive" alt="{$vo.post_title}">


                                    </div>
                                </a>
                                <else />
                            </if>
                        </foreach>
                    </div>
                </div>
                <div class="tc-box">
                    <php>
                        $last_terms=sp_get_terms("field:*;limit:0,8;order:term_id ;where:parent = $par_id;");
                    </php>
                    <ul id="ui_content" class="list-unstyled tc-photos margin-bottom-30" style="margin:5px 0px">
                        <li>
                            <a id="li_quanbu" style="border: inherit;border-radius: inherit;font-size:17px; " href="{:leuu('list/index',array('id'=>$par_id,'pid'=>$par_id))}">全部</a>
                        </li>
                        <foreach name="last_terms" item="vo">
                            <li>
                                <a value="{$vo.name}" style="border: inherit;border-radius: inherit;" href="{:leuu('list/index',array('id'=>$vo['term_id'],'pid'=>$vo['parent']))}">{$vo.name}</a>
                            </li>
                        </foreach>
                    </ul>
                </div>
                <div style="height: 2px;width: 100%;background-color: #efefef;'"></div>
                <php>
                    $lists = sp_sql_posts_paged("cid:$cat_id; order:post_date DESC;",10);
                </php>
                <div id="index_content">

                    <volist name="lists['posts']" id="vo">
                        <php>
                            $smeta=json_decode($vo['smeta'], true);
                            $ssid=$vo['object_id'];
                            $postdate=time_format($vo['post_date']);
                        </php>

                        <div class="list-boxes" style="min-width:830px">
                            <div style="width:29%; float:left;position:relative">
                                <if condition="!empty($smeta['thumb'])">
                                    <div class="item-image" style="height:148px;overflow:hidden;width:100%;margin-top:4px">
                                        <a href="{:leuu('article/index',array('id'=>$vo['object_id'],'cid'=>$vo['term_id']))}">
                                            <img src="{:sp_get_asset_upload_path($smeta['thumb'])}" style="width:100%; height:100%"
                                                 class="img-responsive" alt="{$vo.post_title}">
                                        </a>
                                    </div>
                                    <else />
                                </if>
                            </div>
                            <div style="width:70%; float:right;position:relative;min-width:500px">
                                <h2><a href="{:leuu('article/index',array('id'=>$vo['object_id'],'cid'=>$vo['term_id']))}"><span class="fontmsyhbd" style="font-size: 17px;">{$vo.post_title}</span></a></h2>
                                <p style="height:100px;line-height:25px;">{$vo.post_excerpt|msubstr=0,256}</p>
                                <div>
                                    <!--<div class="pull-left">文/视频联盟</div>-->
                                    <div class="pull-right">
                                        <span class="meta" style="font-size:11px;color:#686568;">{$postdate}</span>
                                    </div>
                                    <div class="pull-left">

                                        <php>
                                            $last_terms=sp_get_terms("field:*;order:term_id asc;where:parent<>0 and  `term_id` in (SELECT `term_id` FROM `rx_term_relationships` where `object_id`=$ssid);");
                                        </php>
                                        <ul class="list-unstyled tc-photos margin-bottom-30">
                                            <li><img style="height: 13px;width: 13px;" alt="" src="themes/simplebootx/Public/assets/images/网站制作_主页文章标签.png"></li>
                                            <foreach name="last_terms" item="voterm">
                                                <li>
                                                    <a style="border-width:0px;  padding: inherit; margin: inherit;" class="index_a" href="{:leuu('list/index',array('id'=>$voterm['term_id']))}">{$voterm.name}</a>
                                                </li>
                                            </foreach>
                                        </ul>
                                    </div>

                                </div>
                                <!-- <div>
                                    <div class="pull-left">
                                        <span class="meta">{$vo.post_keywords}</span>
                                    </div>
                                    <div class="pull-right">
                                        <span class="meta">{$postdate}</span>
                                    </div>
                                </div> -->
                            </div>
                        </div>
                    </volist>

                </div>
                <div style="width:110px;height: 30px;border-radius: 15px;border: 1px solid #C8161D; color: #C8161D;font-size: 15px;text-align: center;
    			line-height: 30px;margin-left: 350px; " class="js-infinite-scroll-loading text-center fontmsyhbd">更多文章</div>
                <div id="nextpage"></div>
            </div>
            <div class="span3">
                <div class="tc-box">
                    <div class="headtitle">
                        <div style="font-size:11px;color:#AEAEAE;line-height:30px; height: 30px;text-align:right;background-image: url('__TMPL__Public/assets/images/网站制作_最新快讯 副本 2.png')">
                            <a href="/index.php?m=list&a=index&id=12">更多...</a>
                        </div>
                    </div>
                    <div class="ranking">
                        <php>

                            $hot_articles=sp_sql_posts("cid:$portal_index_lastnews;field:post_date,post_title,post_excerpt,object_id,term_id,smeta;order: post_date DESC;limit:2;");
                        </php>
                        <ul class="unstyled">
                            <foreach name="hot_articles" item="vo">
                                <php>
                                    $postdate=time_format($vo['post_date']);
                                </php>
                                <li>
                                    <i style="border-radius: 3px;height: 5px;width: 5px;background-color: red;"></i>
                                    <a title="{$vo.post_title}" onclick="loadmore(this)">
                                        <span class="fontmsyhbd" style="font-size: 14px;">{$vo.post_title}</span>
                                        <p id="kuaixunzhaiyao" style="font-size: 11px;color: #686568; height:0px">{$vo.post_excerpt}</p>
                                        <div id="morenshijian" class="list-actions">
                                            <span style="float: left;font-size: 11px;color: #aeaeae;line-height:20px" class="meta">{$postdate}</span>

                                        </div>
                                        <div id="fenxiang" class="list-actions;" style="display:none">
                                            <span style="float: left;font-size: 11px;color: #aeaeae;line-height:20px" class="meta">{$postdate} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;分享至:</span>
                                            <div class="weixin1"></div>
                                            <div class="weibo1"></div>
                                        </div>
                                    </a>
                                </li>
                            </foreach>
                        </ul>
                    </div><a href="/index.php?m=list&a=index&id=12">
                        <div class="fontmsyhbd" style="width: 110px;margin-left: 60px;
					    height: 30px;
					    border: 2px solid #C8161D;
					    border-radius: 25px;
					    color: #C8161D;
					    FONT-SIZE: 15PX;
					    line-height: 30px;
					    text-align: center;">更多资讯</div>
                    </a>
                </div>



                <!-- <div class="tc-box">
                    <div class="headtitle">
                        <h2>相关文章</h2>
                    </div>
                    <php>
                        $last_post=sp_sql_posts("cid:$par_id;field:post_title,post_excerpt,object_id,term_id,smeta;order:istop DESC,post_date desc;limit:3;");
                    </php>
                    <div class="posts">
                        <foreach name="last_post" item="vo">
                            <php>$smeta=json_decode($vo['smeta'],true);</php>
                            <dl class="dl-horizontal">
                                <dt>
                                    <a class="img-wraper" href="{:leuu('article/index',array('id'=>$vo['object_id'],'cid'=>$vo['term_id']))}">
                                        <if condition="empty($smeta['thumb'])">
                                            <img src="__TMPL__Public/assets/images/default_tupian4.png" class="img-responsive" alt="{$vo.post_title}" />
                                            <else />
                                            <img src="{:sp_get_asset_upload_path($smeta['thumb'])}" class="img-responsive img-thumbnail" alt="{$vo.post_title}" />
                                        </if>
                                    </a>
                                </dt>
                                <dd><a href="{:leuu('article/index',array('id'=>$vo['object_id'],'cid'=>$vo['term_id']))}">{:msubstr($vo['post_excerpt'],0,32)}</a></dd>
                            </dl>
                        </foreach>
                    </div>
                </div> -->

                <div style="width: 275px;height: 2px;background-color: #C8161d;"></div>
                <div class="tc-box">
                    <div class="headtitle">
                        <img src="__TMPL__Public/assets/images/index/日新网_热点标签.png" />
                    </div>
                    <php>
                        $last_terms=sp_get_terms("field:*;limit:0,8;order:term_id desc;where:taxonomy='hit';");
                    </php>
                    <ul class="list-unstyled tc-photos margin-bottom-30">
                        <foreach name="last_terms" item="vo">
                            <li>
                                <a href="{:leuu('list/index',array('id'=>$vo['term_id']))}">{$vo.name}</a>
                            </li>
                        </foreach>
                    </ul>
                </div>
                <!--<div class="tc-box">
                    <div class="headtitle">
                        <div style="background-image: url('/themes/simplebootx/Public/assets/images/网站制作_专栏作者.png');
                            font-size: 11px;
                            color: #AEAEAE;
                            text-align: right;
                            background-repeat: no-repeat;
                            height: 30px;
                            line-height: 30px;">更多...</div>
                    </div>
                    <php>
                        $last_terms=sp_get_terms("field:*;limit:0,8;order:term_id desc;where:description like '%热门%';");
                    </php>
                     <foreach name="last_terms" item="vo">
                         <div style="height: 90px;">
                            <div style="float: left;width: 65px;"><img style="width: 65px;height: 65px" alt="" src="http://img1.iyiou.com/Cover/2017-11-17/chanpin-zhinengzhizao.jpg"></div>
                            <div style="height: 65px;width: 180px;float: right;">
                                <div style="width: 3px;height: 3px;background-color: red;border-radius: 2px;float: left;margin: 10px;"></div>
                                <span>作者</span><br/>
                                <span style="margin-left: -13px;">是斯蒂芬斯蒂芬斯蒂芬</span>
                            </div>
                         </div>
                     </foreach>
                </div>-->


            </div>
        </div>


    </div>
    <tc_include file="Public:footer" />

    <!-- JavaScript -->
    <tc_include file="Public:scripts" />
    <script type="text/javascript">
        function loadmore(obj){
            var isHide=false;
            $(obj).find('#kuaixunzhaiyao').each(function () {
                if ($(this).css("height")=="0px") {
                    isHide=true;
                }else {
                    isHide=false;
                }
                if (isHide) {
                    $(this).css("height", "inherit");
                }else {
                    $(this).css("height", "0px");
                }

            });
            $(obj).find('#fenxiang').each(function () {
                if (isHide) {
                    $(this).show();
                }else {
                    $(this).hide();
                }
            });
            $(obj).find('#morenshijian').each(function () {
                if (isHide) {
                    $(this).hide();
                }else {
                    $(this).show();
                }
            });
        }
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $(document).ready(function () {
                $(".box_skitter_large").skitter({
                    animation: "random",
                    interval: 3000,
                    numbers: false,
                    numbers_align: "right",
                    hideTools: true,
                    controls: false,
                    focus: false,
                    focus_position: true,
                    width_label: '425px',
                    enable_navigation_keys: true,
                    progressbar: false
                });
            });
        });
    </script>
    <script src="__TMPL__Public/assets/js/imagesloaded.pkgd.min.js"></script>
    <script src="__TMPL__Public/assets/js/masonry.pkgd.min.js"></script>
    <script src="__TMPL__Public/assets/js/jquery.infiniteScroll.js"></script>
    <script>

        $(function(){
            var isloadquanbu=false;
            console.log($("#hid_select").attr("title"));
            $("#ui_content").find('a').each(function () {
                if ( $("#hid_select").attr("title")==$(this).text()) {
                    $(this).css("color","#C8161d");
                    isloadquanbu=true;
                }
            });
            if (!isloadquanbu) {
                $("#li_quanbu").css("color","#C8161d");
            }

            var $container= $('#index_content').masonry({
                //columnWidth : '.grid-sizer',
                itemSelector : '.list-boxes'
            });

            $container.imagesLoaded().progress(function (imgLoad, image) {
                var msnry = $container.data('masonry');
                var itemSelector = msnry.options.itemSelector;
                var $item = $(image.img).parents(itemSelector);
                $('.list-boxes',$item).css('opacity',1);
                msnry.layout();
            });

            $('#nextpage').infiniteScroll({
                loading:'.js-infinite-scroll-loading',
                total_pages:{$lists['total_pages']},
                success:function(content){
                    var $items=$(content).find('#index_content .list-boxes');
                    if($items.length>0){
                        //$('.tc-gridbox',$items).css('opacity',1);
                        $container.append( $items )
					    // add and layout newly prepended items
					    .masonry( 'appended', $items );
                        $items.imagesLoaded().progress(function (imgLoad, image) {
                            var msnry = $container.data('masonry');
                            var itemSelector = msnry.options.itemSelector;
                            var $item = $(image.img).parents(itemSelector);
                            $('.list-boxes',$item).css('opacity',1);
                            msnry.layout();
                        });
                    }
                },
                finish:function(){

                }
            });
        });
    </script>
</body>
</html>